package com.rxyb.sms.service.factory;

import com.rxyb.sms.service.factory.bami.BamiManagement;
import com.rxyb.sms.service.factory.keyou.KeyouManagement;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class FactoryRoute {

    @Autowired
    private BamiManagement bamiManagement;
    @Autowired
    private KeyouManagement keyouManagement;

    public SmsManagement getFactory(FactoryEnum faEnum) {
        if (faEnum.getKey().equals(FactoryEnum.$Keyou.getKey())) {
            return keyouManagement;
        } else if (faEnum.getKey().equals(FactoryEnum.$Bami.getKey())) {
            return bamiManagement;
        }
        return null;
    }
}
